Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add slack bot integration #934

Closed
wants to merge 1 commit into from

Conversation

darkdarkdragon
Copy link
Contributor

  • add slack settings tab on user's settings page
  • send same messages to user's slack as to gitcoin's slack
Checklist
  • linter status: 100% pass
  • changes don't break existing behavior
  • commit message follows commit guidelines
Affected core subsystem(s)
  • backend
  • frontend
Testing

Tested manually

Refers/Fixes

Fixes: #259

return False
return True

def build_message_for_slack(bounty, event_name):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E302 expected 2 blank lines, found 1

title = bounty.title if bounty.title else bounty.github_url
msg = f"{event_name.replace('bounty', 'funded_issue')} worth {round(bounty.get_natural_value(), 4)} {bounty.token_name} " \
f"{usdt_details}" \
f"{bounty.token_name}: {title} \n\n{bounty.get_absolute_url()}"
return msg

def maybe_market_to_user_slack(bounty, event_name):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E302 expected 2 blank lines, found 1

sc.api_call("chat.postMessage", channel=channel, text=msg)
username = uri_array[1]
repo = uri_array[2]
subscribers = EmailSubscriber.objects.filter(profile__handle=username, repos__contains=[repo]).exclude(slack_token='', slack_channel='')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E501 line too long (144 > 120 characters)

migrations.AddField(
model_name='emailsubscriber',
name='repos',
field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=200), blank=True, default=[], size=None),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E501 line too long (140 > 120 characters)

@@ -614,6 +618,43 @@ def email_settings(request, key):
}
return TemplateResponse(request, 'settings/email.html', context)

def slack_settings(request):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E302 expected 2 blank lines, found 1

@codecov
Copy link

codecov bot commented Apr 21, 2018

Codecov Report

Merging #934 into master will decrease coverage by 0.3%.
The diff coverage is 8.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #934      +/-   ##
==========================================
- Coverage   33.45%   33.14%   -0.31%     
==========================================
  Files         100      100              
  Lines        6238     6305      +67     
  Branches      755      765      +10     
==========================================
+ Hits         2087     2090       +3     
- Misses       4045     4109      +64     
  Partials      106      106
Impacted Files Coverage Δ
app/app/urls.py 93.54% <ø> (ø) ⬆️
app/dashboard/helpers.py 29.3% <0%> (-0.11%) ⬇️
app/dashboard/views.py 17.23% <0%> (-0.13%) ⬇️
app/marketing/models.py 89.53% <100%> (+0.37%) ⬆️
app/dashboard/notifications.py 14.1% <4.65%> (-0.96%) ⬇️
app/marketing/views.py 11.21% <4.76%> (-0.44%) ⬇️
app/app/settings.py 80.27% <0%> (-2.05%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 07903ba...aae7d84. Read the comment docs.

model_name='emailsubscriber',
name='repos',
field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=200), blank=True,
default=[], size=None),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent

- send same messages to user's slack as to gitcoin's slack

Fixes: gitcoinco#259
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants